package com.zrzhen.springbootdemo.controller;

import com.zrzhen.springbootdemo.common.http.Ipphttp;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;

@RestController
@RequestMapping("/asynchttp")
public class AsyncHttpController {

    private static final Logger log = LoggerFactory.getLogger(AsyncHttpController.class);

    @Resource(name = "asyncHttp")
    private Ipphttp ipphttp;

    @GetMapping("/test")
    public String testDeferredResult() {
        String respstr = ipphttp.get("http://www.baidu.com", null, null);
        return respstr;
    }





}
